/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gizelle.myApp.factory;

import com.gizelle.myApp.domain.Address;
import com.gizelle.myApp.domain.Contact;
import com.gizelle.myApp.domain.Equipment;
import com.gizelle.myApp.domain.Gym;
import com.gizelle.myApp.domain.Member;
import com.gizelle.myApp.domain.MemberProgram;
import com.gizelle.myApp.domain.Roles;
import com.gizelle.myApp.domain.Supplements;
import com.gizelle.myApp.domain.User;
import java.util.Date;
import java.util.Map;

/**
 *
 * @author Gizelle
 */
public class AppFactory {

    public static Member getMember(Map<String, String> values, Date dateOfBirth) {
        Member member = new Member();

        member.setFirstName(values.get("firstName"));
        member.setLastName(values.get("lastName"));
        member.setMiddleName(values.get("middleName"));
        member.setGender(values.get("gender"));

        Contact contact = new Contact();
        contact.setEmailAddress(values.get("EmailAddress"));
        contact.setCellPhoneNumber(values.get("CellphoneNumber"));
        contact.setHomeNumber(values.get("homeNumber"));
        contact.setOfficeNumber(values.get("officeNumber"));

        MemberProgram program = new MemberProgram();
        program.setTitle(values.get("title"));
        program.setDescription(values.get("description"));
        program.setWeightLoss(values.get("weightLoss"));
        program.setGoalweight(values.get("goalweight"));
        program.setCurrentweight(values.get("currentweight"));

        return member;

    }

    public static Address getAddress(String physicalAddress, String postalAddress, String postalCode) {
        Address address = new Address();
        address.setPostalAddress(postalAddress);
        address.setPhysicalAddress(physicalAddress);
        address.setPhysicalAddress(postalCode);
        return address;
    }

    public static Gym getGym(String gymID, String name, String address, String telNumber) {
        Gym gym = new Gym();
        gym.setGymID(gymID);
        gym.setName(name);
        gym.setAddress(address);

        return gym;
    }

    public static Equipment getEquipment(String equipmentType, String equipmentID, String quantity) {
        Equipment equipment = new Equipment();
        equipment.setEquipmentType(equipmentType);
        equipment.setEquipmentID(equipmentID);
        equipment.setQuantity(quantity);

        return equipment;
    }

    public static Roles getRoles(String roleName, String description, String userName) {
        Roles role = new Roles();
        role.setRoleName(roleName);
        role.setDescription(description);
        role.setUserName(userName);

        return role;
    }

    public static Supplements getSupplements(String SupplementName, String ingredients, String expiryDate) {
        Supplements supp = new Supplements();
        supp.setSupplementName(SupplementName);
        supp.setIngredients(ingredients);
        supp.setExpiryDate(expiryDate);

        return supp;
    }

    public static User getUser(String userName, String passWord) {
        User user = new User();
        user.setUserName(userName);
        user.setPassWord(passWord);
        

        return user;
    }
}
